﻿using System;
using System.Data;
using System.Data.SQLite;
using System.Text;
using JCode.DBUtility;
using JCode.IDAL;

namespace JCode.SQLiteDAL
{
    public class CodeInfo : ICode
    {
        public int Add(JCode.Model.CodeInfo model)
        {
            SQLiteParameter[] parameters = {
                   
           
                    new SQLiteParameter("@CodeID", DbType.Int32),
                    new SQLiteParameter("@CategoryID", DbType.Int32),
                    new SQLiteParameter("@Title", DbType.String,50),
                    new SQLiteParameter("@Keys", DbType.String,200),
                    new SQLiteParameter("@Content", DbType.String,2000),
                    new SQLiteParameter("@DateCreated", DbType.DateTime),
                    new SQLiteParameter("@DateUpdate", DbType.DateTime)};
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value = model.CategoryID;
            parameters[2].Value = model.Title;
            parameters[3].Value = model.Keys;
            parameters[4].Value = model.Content;
            parameters[5].Value = model.DateCreated;
            parameters[6].Value = model.DateUpdate;
            //SQLHelper.ExecNonQueryReturn_Proc("P_Add_CodeInfo", parameters);
            //return (int)parameters[0].Value;
            SQLite.ExecuteSql("select * from", parameters);
            return (int)parameters[0].Value;
          
        }

        public DataSet GetList(string where)
        {
            return SQLite.GetDataSet("xx");
        }

        public JCode.Model.CodeInfo GetModel(int CodeID)
        {
            return new JCode.Model.CodeInfo();
        }
    }

}
